<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
      }
      html,
      body {
        height: 100%;
      }
      body {
        perspective: 1000px;
      }
      section {
        position: fixed;
        width: 400px;
        height: 400px;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        transform-style: preserve-3d;
        transform: rotateX(20deg) rotateY(30deg);
      }
      div {
        width: 400px;
        height: 400px;
        font-size: 50px;
        text-align: center;
        line-height: 400px;
        color: #fff;
        position: absolute;
        left: 0;
        top: 0;
      }
      div:nth-child(1) {
        background-color: red;
        transform: translateZ(200px);
      }
      div:nth-child(2) {
        background-color: orange;
        transform: translateZ(-200px) rotateY(180deg);
      }
      div:nth-child(3) {
        background-color: yellow;
        transform: translateY(-200px) rotateX(90deg);
      }
      div:nth-child(4) {
        background-color: green;
        transform: translateY(200px) rotateX(-90deg);
      }
      div:nth-child(5) {
        background-color: cyan;
        transform: translateX(-200px) rotateY(-90deg);
      }
      div:nth-child(6) {
        background-color: blue;
        transform: translateX(200px) rotateY(90deg);
      }
    </style>
  </head>
  <body>
    <section>
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
      <div>6</div>
    </section>
  </body>
</html>
